package com.xy.config;

import com.xy.bean.Car;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/4/8 17:08
 * @description Bean 的生命周期
 */


@ComponentScan("com.xy.bean")
@Configuration
public class ConfigOfLifeCycle {

    //@Scope("prototype")
    @Bean(initMethod = "init",destroyMethod = "destroy")
    public Car car() {
        return new Car();
    }
}
